package com.dofast.module.system.dal.mysql.expresselectronicsheet;

import java.util.*;

import com.dofast.framework.common.pojo.PageResult;
import com.dofast.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.dofast.framework.mybatis.core.mapper.BaseMapperX;
import com.dofast.module.system.dal.dataobject.expresselectronicsheet.ExpressElectronicsheetDO;
import org.apache.ibatis.annotations.Mapper;
import com.dofast.module.system.controller.admin.expresselectronicsheet.vo.*;

/**
 * 电子面单 Mapper
 *
 * @author 惠智造
 */
@Mapper
public interface ExpressElectronicsheetMapper extends BaseMapperX<ExpressElectronicsheetDO> {

    default PageResult<ExpressElectronicsheetDO> selectPage(ExpressElectronicsheetPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExpressElectronicsheetDO>()
                .likeIfPresent(ExpressElectronicsheetDO::getTemplateName, reqVO.getTemplateName())
                .eqIfPresent(ExpressElectronicsheetDO::getCompanyId, reqVO.getCompanyId())
                .likeIfPresent(ExpressElectronicsheetDO::getCompanyName, reqVO.getCompanyName())
                .eqIfPresent(ExpressElectronicsheetDO::getExpressNo, reqVO.getExpressNo())
                .likeIfPresent(ExpressElectronicsheetDO::getCustomerName, reqVO.getCustomerName())
                .eqIfPresent(ExpressElectronicsheetDO::getCustomerPwd, reqVO.getCustomerPwd())
                .eqIfPresent(ExpressElectronicsheetDO::getSendSite, reqVO.getSendSite())
                .eqIfPresent(ExpressElectronicsheetDO::getSendStaff, reqVO.getSendStaff())
                .eqIfPresent(ExpressElectronicsheetDO::getMonthCode, reqVO.getMonthCode())
                .eqIfPresent(ExpressElectronicsheetDO::getPostagePaymentMethod, reqVO.getPostagePaymentMethod())
                .eqIfPresent(ExpressElectronicsheetDO::getIsNotice, reqVO.getIsNotice())
                .eqIfPresent(ExpressElectronicsheetDO::getStatus, reqVO.getStatus())
                .eqIfPresent(ExpressElectronicsheetDO::getIsDefault, reqVO.getIsDefault())
                .eqIfPresent(ExpressElectronicsheetDO::getPrintStyle, reqVO.getPrintStyle())
                .betweenIfPresent(ExpressElectronicsheetDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ExpressElectronicsheetDO::getId));
    }

    default List<ExpressElectronicsheetDO> selectList(ExpressElectronicsheetExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ExpressElectronicsheetDO>()
                .likeIfPresent(ExpressElectronicsheetDO::getTemplateName, reqVO.getTemplateName())
                .eqIfPresent(ExpressElectronicsheetDO::getCompanyId, reqVO.getCompanyId())
                .likeIfPresent(ExpressElectronicsheetDO::getCompanyName, reqVO.getCompanyName())
                .eqIfPresent(ExpressElectronicsheetDO::getExpressNo, reqVO.getExpressNo())
                .likeIfPresent(ExpressElectronicsheetDO::getCustomerName, reqVO.getCustomerName())
                .eqIfPresent(ExpressElectronicsheetDO::getCustomerPwd, reqVO.getCustomerPwd())
                .eqIfPresent(ExpressElectronicsheetDO::getSendSite, reqVO.getSendSite())
                .eqIfPresent(ExpressElectronicsheetDO::getSendStaff, reqVO.getSendStaff())
                .eqIfPresent(ExpressElectronicsheetDO::getMonthCode, reqVO.getMonthCode())
                .eqIfPresent(ExpressElectronicsheetDO::getPostagePaymentMethod, reqVO.getPostagePaymentMethod())
                .eqIfPresent(ExpressElectronicsheetDO::getIsNotice, reqVO.getIsNotice())
                .eqIfPresent(ExpressElectronicsheetDO::getStatus, reqVO.getStatus())
                .eqIfPresent(ExpressElectronicsheetDO::getIsDefault, reqVO.getIsDefault())
                .eqIfPresent(ExpressElectronicsheetDO::getPrintStyle, reqVO.getPrintStyle())
                .betweenIfPresent(ExpressElectronicsheetDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ExpressElectronicsheetDO::getId));
    }

}
